package com.prs.crm.domain.sale;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.prs.crm.domain.FlowCodeEntity;
import com.prs.crm.domain.hr.Person;

@Entity
@Table(name = "sale_SaleInvoices")
public class SaleInvoices extends FlowCodeEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	/**
	 * 底单编号
	 */

	private String billCode;

	/**
	 * 金额
	 */

	private Double billAmount;

	/**
	 * 开票日期
	 */
	private Date checkDate;

	/**
	 * 对应销售单
	 */
	@ManyToOne
	private SalesContract salesContract;

	/**
	 * 对应销售人员
	 */
	@ManyToOne
	private Person person;

	/**
	 * 票价类型
	 * 
	 */
	@ManyToOne
	private InvoiceType invoiceType;

	/**
	 * 票据单号
	 * 
	 */
	private String invoiceCode;
	
//	@OneToOne(fetch=FetchType.LAZY,mappedBy="saleInvoices")
//	private Code code;


	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getBillCode() {
		return billCode;
	}

	public void setBillCode(String billCode) {
		this.billCode = billCode;
	}



	public Double getBillAmount() {
		return billAmount;
	}

	public void setBillAmount(Double billAmount) {
		this.billAmount = billAmount;
	}

	public Date getCheckDate() {
		return checkDate;
	}

	public void setCheckDate(Date checkDate) {
		this.checkDate = checkDate;
	}





	public SalesContract getSalesContract() {
		return salesContract;
	}

	public void setSalesContract(SalesContract salesContract) {
		this.salesContract = salesContract;
	}

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public InvoiceType getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(InvoiceType invoiceType) {
		this.invoiceType = invoiceType;
	}

	public String getInvoiceCode() {
		return invoiceCode;
	}

	public void setInvoiceCode(String invoiceCode) {
		this.invoiceCode = invoiceCode;
	}

//	public Code getCode() {
//		return code;
//	}
//
//	public void setCode(Code code) {
//		this.code = code;
//	}

}
